<template>
  <div class="yingyong">
    <nav>
      <button @click="emitMainEvent">子应用发通知</button>
    </nav>
    <HelloWorld msg="子应用" />
  </div>
</template>

<script setup lang="ts">
import HelloWorld from "./components/HelloWorld.vue";

window.$wujie?.bus.$on("mainNotity", function (value: string) {
  alert(`子应用接收到基座应用通知值为(${value})`);
});

const emitMainEvent = () => {
  window.$wujie?.bus.$emit("mainAlert", "子应用传值");
};
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
.yingyong {
  background-color: bisque;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
